{% extends "base.html" %}

{% block menubar %}
{% endblock %}



{% block content %}
	
<div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">修改密码</h3>
            </div>
            <div class="panel-body">
<form id="chpwd" action="/admin" method="POST">
{% if chpwdtips %}
    <p style="color:red;font-size:0.8em;">{{chpwdtips}}</p>
 {% endif %}
    <table id="tb_chpwd" align='center'>
    <tr>
        <td style="text-align:right;">原密码：</td>
        <td><input class="form-control" type="password" name="op" id="orgpwd" required autofocus></td>
    </tr>
    <tr>
        <td style="text-align:right;">新密码：</td>
        <td><input class="form-control" type="password" name="p1" id="newpwd1" required></td>
    </tr>
    <tr>
        <td style="text-align:right;">再次输入新密码：</td>
        <td><input class="form-control" type="password" name="p2" id="newpwd2" required></td>
    </tr>
    <tr>
        <td></td>
        <td><input type="submit" class="btn btn-primary" value="提交"></td>
    </tr>
    </table>
    </form>
            </div>
          </div>

{% if user.level == 3 %}
		  <div class="panel panel-default">
            <div class="panel-heading">
              <h3 class="panel-title">用户账号列表</h3>
            </div>
            <div class="panel-body">
              <table id="tb_cm" class="table table-bordered">
        <tr class="usrtbhead">
        <th class="usrh">序号</th><th class="usrh">用户名</th>
        <th class="usrh">使能发送</th>
	<th class="usrh">kindle_email</th>
        <th class="usrh">上次登录</th>
	<th class="usrh">-</th>
        </tr>
      {% for u in users %}
        <tr class="usrrow">
        <th class="usrh">{{loop.index}}</th><th class="usrh">{{u.name}}</th>
        <th class="usrh">{{u.enable_send}}</th>
        <th class="usrh">{{u.kindle_email}}</th>
        <th class="usrh">{{u.login_time}}</th>
        <th class="usrh"><a href="delaccount?u={{u.name}}">删除账户</a></th>
        </tr>
        {% endfor %}  
		</table>
		<div class="btn-toolbar" role="toolbar">
{% for page in range(1,pages+1) %}
  <div class="btn-group"><a href="/admin/?page={{page}}">{{page}}</a></div>
{% endfor %}
</div>
            </div>
          </div>
{% endif %}

{% endblock %}
